#include <header.h>

pthread_spinlock_t lock;

void *run(void *p){
	pthread_spin_lock(&lock);
	printf("thread\n");
	pthread_spin_unlock(&lock);
	return NULL;
}


int main(int argc, char* argv[]){
	pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE);
	
	pthread_t p;
	pthread_create(&p, NULL, run, NULL);

	pthread_spin_lock(&lock);

	sleep(2);
	printf("main\n");
	pthread_spin_unlock(&lock);



	pthread_join(p, NULL);
	pthread_spin_destroy(&lock);
	return 0;
}